mend one's ways

Improve one's behavior, as in Threatened with suspension, Jerry promised to mend his ways. This expression, transferring a repair of clothes to one of character, was first recorded in 1868, but 150 or so years earlier it had appeared as mend one's manners.